package com.springboot.example.monitor.dao.impl;

import com.springboot.example.monitor.dao.ProjectDao;
import com.springboot.example.monitor.mapper.ProjectMapper;
import com.springboot.example.monitor.domain.db.Project;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * Project
 * <p/>
 * User: guoyao
 * DateTime: 2016-02-23 16:23:51
 */
@Service("projectDao")
public class ProjectDaoImpl implements ProjectDao {

    @Resource
    private ProjectMapper projectMapper;

    /**
     * 根据主键查询Project对象
     *
     * @param projectId
     * @return Project对象
     */
    @Override
    public Project selectByPrimaryKey(Long projectId) {
        return projectMapper.selectByPrimaryKey(projectId);
    }

    /**
     * 根据查询条件查询符合条件的Project对象
     *
     * @param project
     * @return 符合条件的Project对象List
     */
    @Override
    public List<Project> select(Project project) {
        return projectMapper.select(project);
    }

    /**
     * 根据主键删除Project对象
     *
     * @param projectId
     * @return 影响条件数
     */
    @Override
    public int deleteByPrimaryKey(Long projectId) {
        return projectMapper.deleteByPrimaryKey(projectId);
    }

    /**
     * 根据条件删除符合条件的Project对象
     *
     * @param project
     * @return 影响条件数
     */
    @Override
    public int delete(Project project) {
        return projectMapper.delete(project);
    }

    /**
     * 插入Project对象
     *
     * @param project
     * @return 影响条件数
     */
    @Override
    public int insert(Project project) {
        return projectMapper.insert(project);
    }

    /**
     * 更新Project对象
     *
     * @param project
     * @return 影响条件数
     */
    @Override
    public int update(Project project) {
        return projectMapper.update(project);
    }
}
